package com.xx.mapper;

import com.xx.entity.Categories;
import com.xx.entity.CategoriesList;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface CategoriesMapper {
    //ID查询
    Categories queryById(Integer categoryId);

    //查询指定行数据
    List<Categories> queryAllByLimit(Categories categories);

    //统计总行数
    long count(Categories categories);

    //新增数据
    int insert(Categories categories);

    //批量新增数据
    int insertBatch(@Param("entities") List<Categories> entities);

    //批量新增或按主键更新数据
    int insertOrUpdateBatch(@Param("entities") List<Categories> entities);

    //修改数据
    int update(Categories categories);

    //主键删除
    int deleteById(Integer categoryId);

    List<CategoriesList> list();
}
